package com.quantdo.demo.date;


public class TomcatProcessElement {
	private String id;
	private String user;
	private String path;
	private String status;
	private String pid;

	public TomcatProcessElement(String processlist) {
		//24410 root /home/web/software/apache-tomcat-9.0.30
		if(null != processlist && 0 < processlist.indexOf(" ")){
			String[] item = processlist.split(" ");
			this.id = item[2];
			this.user = item[1];
			this.path = item[2];
			this.status = item[0];
			this.pid = item[0];
		}
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getUser() {
		return user;
	}

	public void setUser(String user) {
		this.user = user;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getPid() {
		return pid;
	}

	public void setPid(String pid) {
		this.pid = pid;
	}

	@Override
	public String toString() {
		return "TomcatProcessElement [id=" + id + ", user=" + user + ", path=" + path + ", status=" + status + ", pid=" + pid + "]";
	}

}
